<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>08_侦听器</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        单价：10元<br/>
        数量：<input type="text" v-model="number" /> <br/>
        <h3>总价：{{total}}元</h3>
    </div>


    <script>
        const vm = new Vue({
            el:'#app',
            data:{
                number: 0,
                total: 0
            },
            watch:{
                number(){
                    this.total = this.number * 10;
                }
            }
        });
    </script>
</body>
</html>